Repository navigation
chore(nix): unify Linux cross-compilation toolchains - #3242
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
/ok-to-test 7e53559 |
|
/ok-to-test 675411f |
|
/ok-to-test dc6a328 |
|
/ok-to-test 6067054 |
Replace the separate GNU and musl development shells with one shell that provides explicit toolchains for x86_64 and aarch64 Linux, plus native Darwin on macOS. Cargo selects the compiler, assembler, archiver, and linker through target-specific environment variables. Build GNU targets against a glibc 2.28 sysroot with static GCC runtimes and use the musl toolchains for static Linux executables. Build Z3 and AWS-LC with each target's stdenv and expose AWS-LC libraries and Rust bindings through its target-specific system directory. Keep Darwin system libraries on the unprocessed Apple SDK and prevent the Rust toolchain from propagating replacement libraries into the shell. Include the compiler and libc fixes needed for Darwin-to-Linux builds. Share dependency and environment wiring through mkToolchain, keep compiler wrappers in the Linux and Darwin modules, and group the pinned GNU build environment under glibc-2.28. Document the toolchain boundaries in the build architecture overview. Validation: actionlint and nix fmt pass. The toolchain refactor preserves the shell derivations for x86_64 Linux, aarch64 Linux, and aarch64 Darwin. Signed-off-by: Simon Scatton <sscatton@nvidia.com>
6067054 to
2b2a48e
Compare
Remove the dev-shell input and its matrix and workflow plumbing. Use the host default shell for builds and cache hashing. Signed-off-by: Simon Scatton <sscatton@nvidia.com>
|
🌿 Preview your docs: https://nvidia-preview-pr-3242.docs.buildwithfern.com/openshell |
Use target-specific artifact paths and rely on the Nix toolchains for linkage. Remove post-link rewriting, platform linkage checks, and the unused interpreter input. Update the build architecture documentation. Signed-off-by: Simon Scatton <sscatton@nvidia.com>
|
Label |
|
/ok-to-test a874eb8 |
|
Label |
|
Label |
Use a pinned historical Nixpkgs recipe for glibc 2.28 and rebuild GCC 15 against it instead of maintaining separate runtime builds. Keep only compatibility adjustments needed by the current build tools. Assemble the sysroot from glibc outputs and static native libraries. Use standard ELF interpreters and resolve Rust's explicit gcc_s dependency through the static GCC archives. Allow 90 minutes for Rust branch checks to accommodate cold toolchain builds. Validate the Linux release matrix locally; Darwin remains for CI. Signed-off-by: Simon Scatton <sscatton@nvidia.com>
Avoid building rpcgen against the Darwin SDK, which does not expose stat64. Signed-off-by: Simon Scatton <sscatton@nvidia.com>
Summary
Replace the separate GNU and musl Nix development shells with one default shell
providing explicit Linux target toolchains and a native Darwin toolchain on macOS.
Release binary builds select their toolchain with Cargo's
--targetand use theresulting binary directly, without post-link rewriting.
Related Issue
No issue linked yet. Issue linkage remains to be resolved before marking this
draft ready.
Changes
mkToolchain, withshared environment wiring and separate Linux and Darwin compiler wrappers.
Build static Z3 and AWS-LC libraries with each target's stdenv.
toolchain from propagating replacement system libraries into the shell.
dev-shellinput and matrix fields. Build release binaries withcargo auditable build --target <triple>and verify/upload artifacts fromtarget/<triple>/release/.and the unused
interpreterinput. Retain binary--versionand Syft metadatachecks. Branch checks continue to use Cargo's default host target.
Testing
all three derivations remain identical across the toolchain refactoring.
nix fmtandgit diff --checkpass.Release Dev/Tag input removal was checked with ShellCheck disabled because
those workflows have existing unrelated ShellCheck findings.
builds/tests in
branch-checks.Checklist